﻿<!--{inc(header.view.html)}-->

<div class="content" id="content">
	<div class="top-menu-box">
    	<div class="z">
            <span class="z-f"><a href="#">用户数据</a>&nbsp;&gt;</span>
            <span class="z-f"><a href="#">字段添加</a></span>
            <div class="z-f-r"><span class="user-t"><a href="{$site_url}"  target="_blank">网站首页</a></span><span class="user-info"></span><a href="index.php?app=default&act=quit" onClick="return confirm('确认退出管理系统吗？');"   >退出管理</a></div>
        </div>
        <div class="top-menu">
        	<ul>
			

                                                 <li><a href="index.php?app=usertype&act=index"  target="mainframe">会员模型列表</a></li>  												 
                                                 <li><a href="index.php?app=usertype&act=filedlist&id={$id}"  target="mainframe">字段列表</a></li>
            	                                 <li class="current"><a href="#">字段添加</a></li>												 
				
			
            </ul>
            <div class="clear"></div>
        </div>
    </div>
    
    <div class="main">

<form action="?app=usertype&act=filedpostadd" method="post" >

    <table  class="data" >
<tbody> 


<tr>
	<td>字段中文名:</td>
	<td><input type="text" maxlength="20"  size="30" name="data[filed][cname]" value=""></td>
</tr>

<tr>
	<td>提示信息:</td>
	<td><input type="text" maxlength="20"  size="30" name="data[tips]" value=""></td>
</tr>


 <tr>
	<td width="30%">数据库字段名:</td>
	<td><input type="text" maxlength="50" size="50" value="my_" name="data[filed][name]"></td>
</tr>

<tr>
	<td>数据库字段数据类型:</td>
	<td>  <select name="data[filed][type]"  onChange="field_choose(this.options[this.selectedIndex].value)">
                 <option value="varchar">varchar</option>
                <option value="tinyint">tinyint</option>
                <option value="text">text</option>
                <option value="data">data</option>
                <option value="smallint">smallint</option>
                <option value="mediumint">mediumint</option>
                <option value="int">int</option>
                <option value="bigint">bigint</option>
                <option value="float">float</option>
                <option value="double">double</option>
                <option value="decimal">decimal</option>
                <option value="datetime">datetime</option>
                <option value="timestamp">timestamp</option>
                <option value="time">time</option>
                <option value="year">year</option>
                <option value="char">char</option>
                <option value="tinyblob">tinyblob</option>
                <option value="tinytext">tinytext</option>
                <option value="blob">blob</option>
                <option value="mediumblob">mediumblob</option>
                <option value="mediumtext">mediumtext</option>
                <option value="longblob">longblob</option>
                <option value="longtext">longtext</option>
                <option value="enum">enum</option>
                <option value="set">set</option>
                <option value="bool">bool</option>
                <option value="binary">binary</option>
                <option value="varbinary">varbinary</option>
        </select>		
		
</td>
</tr>

<tr>
	<td>数据库字段长度:</td>
	<td><input type="text" maxlength="20"  size="8" name="data[filed][length]" value=""></td>
</tr>

<tr>
	<td>数据库字段是否为null:</td>
	<td>
	<select name="data[filed][isnull]" >
    <option value="NOT NULL" selected="selected" >not null</option>
    <option value="">null</option>
 
    </select>
</td>
</tr>

<tr>
	<td>数据库字段的默认值:</td>
	<td>
	<input  type="text" name="data[filed][defaultv]" size="12" value=""  />
</td>
</tr>

<tr>
	<td>用户填写的表单类型:</td>
	<td>  <select name="data[form][type]"  onChange="form_choose(this.options[this.selectedIndex].value)">

<?php foreach((array)$mdivdata as $_key => $_value ) { ?>


          <option value="{$_value.config.type}"  <?php if ($_key == 0) { ?> selected <?php } ?> >{$_value.title}</option>

         
<?php } ?>
 
        </select>

</td>
</tr>

<?php foreach((array)$mdivdata as $_key => $_value ) { ?>

<tr id="field_form_{$_value.config.type}"  <?php if ($_key != 0) { ?>style="display:none;" <?php } ?> > 
      <td >表单[{$_value.title}]属性:</td> 
      <td > 
	<?php foreach((array)$_value.config as $_key1 => $_value1 ) { ?>
	<?php if ($_key1 != 'name' && $_key1 != 'type' && $_key1 != 'appname') { ?>	
	  {$_key1}=<input type="text"  size="255"  name="data[form][{$_value.config.type}][{$_key1}]" value="{$_value1}" style="width:400px;"><br/>	 
	 <?php } ?>	  
    <?php } ?>		  
      </td>
    </tr>

<?php } ?>
<tr>
	<td>value值调用(sx数据):</td>
	<td>
 <input type="text" name="data[sx_data]" size="60" value="" id="keyword_r">
    	                                 <select name="select4" onChange="MM_keyword2(this,'keyword_r')" > 
										 <option  value="">请选择...</option> 
                                          <?php foreach((array)$sxarray as $_key => $_value ) { ?>

 		                                  <option  value="{$_value}">{$_key}</option> 

										 <?php } ?> 
	                                     </select>	      
    </td>
</tr> 

<tr>
	<td>排序:</td>
	<td>
    <input type="text" maxlength="3"  size="3" name="data[sort]" value="255">
 
    
    </td>
</tr>  
<tr>
	<td>&nbsp;</td>
	<td><input name="tbid" type="hidden" value="" /><input name="id" type="hidden" value="{$id}" /><input name="data[tablev]" type="hidden" value="{$id}" /><input type="submit" value=" 提 交 " class="buton"></td>
</tr>
</tbody></table>
</form>                                 
                                 
<SCRIPT LANGUAGE="JavaScript"> 

<!--
function get_obj(obj){
   return document.getElementById(obj);
}
function MM_keyword2(selObj,str){ //v3.0
  va=selObj.options[selObj.selectedIndex].value
  if (va!='')
  {

		get_obj(str).value=va;

  } 
}

function field_choose(t)
{
	if(t=='mediumtext')
	{
		get_obj('field_leng_tr').style.display='none';
	}else
	{
		get_obj('field_leng_tr').style.display='';
	}
}
field_choose('varchar');
 
 
function form_choose(t)
{
	
<?php foreach((array)$mdivdata as $_key => $_value ) { ?>

	if(t=='{$_value.config.type}')
	{
		get_obj('field_form_{$_value.config.type}').style.display='';		    
	}else
	{
		get_obj('field_form_{$_value.config.type}').style.display='none';		    
	}	


<?php } ?>
}
form_choose('{$mdivdata.0.config.type}');


//-->
</SCRIPT>

 

 	
	
	

        
        <div class="notic"><img  src="{$web_view_dir}style/images/light.gif" align="absmiddle" /> <b>提示: </b> <span ></span></div>
    </div>
</div>
<!--{inc(footer.view.html)}-->